<div class="mt20 clearfix ng-scope ml25">
    <span class="fl lh30 f14">应收信息</span>

    <div class="fr btn-group">
        <button href="javascript:;" class="btn"
                ui-dialog="新增款项"
                ui-dialog-data="{}"
                ui-dialog-show="receivableFundService.onFundEditShow(contractBaseInfo.contract_id,$dialog,$dialogScope,'','',contractBaseInfo.busnisseType,'1')"
                ui-dialog-ok="receivableFundService.editFundSave($data,$dialog,$dialogScope, reloadFunds)"
                ui-dialog-cache="false"
                ui-dialog-url="/contract/editinc/receivable-inc-edit-fund.html"
                ng-if="contractBaseInfo.is_cancelled == 0"
                >新增款项
        </button>
    </div>
</div>
<div id="grid" class="table-wrap mt10 ml25"
     ng-if="!([3,4].indexOf(contractBaseInfo.busnisseType)>=0)"
     style="min-height: 200px;overflow: visible">

    <table width="100%" class="valign-t">
        <thead>
        <tr>
            <th width="35">序号</th>
            <th width="60">合同属性</th>
            <th width="100">款项名称</th>
	        <th width="100">产品类型</th>
            <th width="100">业务收入项</th>
            <th width="100">应收信息</th>
            <th width="70">收款责任人</th>
            <th width="100">金额信息</th>
            <th width="80">附加信息</th>
            <th width="60">操作</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="record in receivableInfo.receivables" ng-if="record.__isdelete != 1">
            <td height="40"><p ng-bind="$index + 1"></p></td>
            <td><p>{{record.contract_property==0?'新增':'续约'}}</p></td>
            <td class="lh14">
                <p ng-bind="record.receivable_item_name"></p>

                <p class="c-gray">款项小类:{{record.money_category_item_name}}</p>
            </td>
	        <td>
		        <p ng-bind="contractBaseInfo.business_product"></p>
	        </td>
            <td>
                <p ng-bind="record.revenue_type_name"></p>
            </td>
            <td>
                <p>应收金额:{{record.receivable_amount | number:2}}</p>

                <p>应收日期:{{record.receivable_date|strdate:'yyyy-MM-dd'}}</p>
            </td>
            <td>
                <p ng-bind="record.payee_name"></p>
            </td>
            <td>
                <p>已开票金额:{{record.billing_amount | number:2}}</p>

                <p>已收金额:{{record.received_amount | number:2}}</p>

                <p>未收金额:{{record.receivable_amount-record.received_amount | number:2}}</p>
            </td>
            <td>
                <p>是否坏账:{{record.is_bad_debt==1?'是':'否'}}</p>

                <p>运营关注项:{{record.is_operation==1?'是':'否'}}</p>
            </td>
            <td>
                <div row-toolbar min-buttons-show="3" ng-if="contractBaseInfo.contract_status == 0">
                    <a href="javascript:;"
                       ui-dialog="修改款项"
                       ui-dialog-data="{}"
                       ui-dialog-show="receivableFundService.onFundEditShow(contractBaseInfo.contract_id,$dialog,$dialogScope, record)"
                       ui-dialog-ok="receivableFundService.editFundSave($data,$dialog,$dialogScope, reloadFunds)"
                       ui-dialog-cache="false"
                       ui-dialog-url="/contract/editinc/receivable-inc-edit-fund.html"
                       ng-if="contractBaseInfo.contract_status == 0"
                            >修改
                    </a>
                    <a href="javascript:void(0)" class="clearfix"
                       title="删除款项"
                       ng-click="receivableFundService.deleteFund(record)">删除</a>
                    <a href="javascript:void(0)" class="clearfix hide"
                       title="设置为运营关注款" ng-if="record.is_operation == 0"
                       ng-click="receivableFundService.markOperation(record, 1, reloadFunds)">运营关注款</a>
                    <a href="javascript:void(0)" class="clearfix hide"
                       title="取消运营关注款" ng-if="record.is_operation == 1"
                       ng-click="receivableFundService.markOperation(record, 0, reloadFunds)">取消运营关注款</a>
                </div>
                <div row-toolbar min-buttons-show="3" ng-if="contractBaseInfo.contract_status == 2">
                    <a href="javascript:;" class="clearfix"
                       ui-dialog="款项拆分"
                       ui-dialog-data="{}"
                       ui-dialog-show="receivableFundService.onFundEditShow(contractBaseInfo.contract_id,$dialog,$dialogScope, record, true)"
                       ui-dialog-ok="receivableFundService.editFundSave($data,$dialog,$dialogScope, reloadFunds)"
                       ui-dialog-cache="false"
                       ui-dialog-url="/contract/editinc/receivable-inc-edit-fund.html"
                       ng-if="record.billing_amount==0"
                            >款项拆分
                    </a>

                    <a href="javascript:;" class="clearfix"
                       ui-dialog="责任人变更"
                       ui-dialog-data="{}"
                       ui-dialog-show="receivableFundService.onFundEditChangePayeeShow(contractBaseInfo.contract_id,$dialog,$dialogScope, record)"
                       ui-dialog-ok="receivableFundService.changePayee($data,$dialog,$dialogScope, reloadFunds)"
                       ui-dialog-cache="false"
                       ui-dialog-url="/contract/editinc/receivable-inc-edit-fund-change-payee.html"
                            >责任人变更
                    </a>
                    <a href="javascript:;" class="clearfix"
                       ui-dialog="应收时间变更"
                       ui-dialog-data="{}"
                       ui-dialog-show="receivableFundService.onFundEditChangePayeeShow(contractBaseInfo.contract_id,$dialog,$dialogScope, record)"
                       ui-dialog-ok="receivableFundService.changeReceivableDate($data,$dialog,$dialogScope, reloadFunds)"
                       ui-dialog-cache="false"
                       ui-dialog-url="/contract/editinc/receivable-inc-edit-fund-change-date.html"
                            >应收时间变更
                    </a>
                    <a href="javascript:void(0)" class="clearfix"
                       title="标记为坏账"
                       ng-if=" record.is_bad_debt==0"
                       ng-click="receivableFundService.markBadBebtConfim(record, 1, reloadFunds)">标记为坏账</a>
                    <a href="javascript:void(0)" class="clearfix"
                       title="设置为运营关注款" ng-if="record.is_operation == 0 && 1==2"
                       ng-click="receivableFundService.markOperation(record, 1, reloadFunds)">运营关注款</a>
                    <a href="javascript:void(0)" class="clearfix" style="width:120px;"
                       title="取消运营关注款" ng-if="record.is_operation == 1 && 1==2"
                       ng-click="receivableFundService.markOperation(record, 0, reloadFunds)">取消运营关注款</a>
                </div>
            </td>
        </tr>
        </tbody>
    </table>
    <div class="no-data" ng-if="funds.length == 0" style="height:180px"><span>暂无数据</span></div>

</div>

<!--供应商考察报告, 云采购会员-->
<div id="grid2" class="table-wrap mt10 ml25"
     ng-if="[3,4].indexOf(contractBaseInfo.busnisseType)>=0"
     style="min-height: 200px;overflow: visible">

	<table width="100%" class="valign-t">
		<thead>
		<tr>
			<th width="35">序号</th>
			<th width="35">款项名称</th>
			<th width="100">产品类型</th>
			<th width="100">应收金额</th>
			<th width="100">应收时间</th>
			<th width="70">收款责任人</th>
		</tr>
		</thead>
		<tbody>
		<tr ng-repeat="record in receivableInfo.receivables" ng-if="record.__isdelete != 1">
			<td height="40"><p ng-bind="$index + 1"></p></td>
			<td><p>{{record.contract_property==0?'新增':'续约'}}</p></td>
			<!--<td class="lh14">-->
				<!--<p ng-bind="record.receivable_item_name"></p>-->

				<!--<p class="c-gray">款项小类:{{record.money_category_item_name}}</p>-->
			<!--</td>-->
			<td>
				<p ng-bind="contractBaseInfo.business_product"></p>
			</td>
			<td>
				<p>{{record.receivable_amount | number:2}}</p>
			</td>
			<td>
				<p>{{record.receivable_date|strdate:'yyyy-MM-dd'}}</p>
			</td>
			<td>
				<p ng-bind="record.payee_name"></p>
			</td>
		</tr>
		</tbody>
	</table>
	<div class="no-data" ng-if="funds.length == 0" style="height:180px"><span>暂无数据</span></div>

</div>